package store.lunangangster.engine.impl.entity;

import java.util.HashMap;
import java.util.Map;

public class ResourceEntityImpl extends EntityImpl implements ResourceEntity {

  // DB property
  protected String name;
  protected byte[] bytes;
  protected String deploymentId;

  @Override
  public String getName() {
    return name;
  }

  @Override
  public void setName(String name) {
    this.name = name;
  }

  @Override
  public byte[] getBytes() {
    return bytes;
  }

  @Override
  public void setBytes(byte[] bytes) {
    this.bytes = bytes;
  }

  @Override
  public String getDeploymentId() {
    return deploymentId;
  }

  @Override
  public void setDeploymentId(String deploymentId) {
    this.deploymentId = deploymentId;
  }

  @Override
  public Object getPersistState() {
    Map<String, Object> persistState = new HashMap<>();

    persistState.put("name", name);
    persistState.put("bytes", bytes);
    persistState.put("deploymentId", deploymentId);

    return persistState;
  }
}
